<template>
  <a-modal
    :title="title"
    :width="width"
    :closable="false"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
    destroyOnClose
  >
    <a-spin :spinning="confirmLoading">
      <erp-payroll-ledger-list-detail :ledgerId="ledgerId"></erp-payroll-ledger-list-detail>
    </a-spin>
    <template slot="footer">
      <a-button @click="handleCancel">关闭</a-button>
    </template>
  </a-modal>
</template>

<script>

  import ErpPayrollLedgerListDetail from "../../payrollLedger/ErpPayrollLedgerListDetail.vue";

  export default {
    name: "ErpPayrollLedgerModal",
    components: {
      ErpPayrollLedgerListDetail
    },
    data () {
      return {
        title:"查看工资条",
        width:"80%",
        visible: false,
        confirmLoading: false,
        ledgerId: ''
      }
    },
    created () {
    },
    methods: {
      handleCancel () {
        this.visible = false;
      },
      edit(record){
        this.title = record.employeeName + '的工资条'
        this.ledgerId = record.id
        this.visible = true
      }
    }
  }
</script>

<style scoped>

</style>